<template>
     <div>
        <el-page-header @back="goBack" title= "返回" :content="content"></el-page-header>
        {{form}}
        <el-form ref="form" :model="form" label-width="80px">
            <el-form-item label="模型名称">
                <el-input v-model="form.name" size="small"></el-input>
            </el-form-item>
            <el-form-item label="算法">
                <el-input v-model="form.algorithm" size="small"></el-input>
            </el-form-item>
            <el-form-item label="介绍">
                <el-input v-model="form.introduce" size="small"></el-input>
            </el-form-item>
            <el-form-item label="状态">
                <el-input v-model="form.status" size="small"></el-input>
            </el-form-item>

            <el-form-item>
                <div style="text-align:right">
                    <el-button type="primary" @click="submitHandler">提交</el-button>
                </div>
      </el-form-item>
        </el-form>
    </div>
</template>

<script>
import { post } from '@/utils/request'
export default {
    data(){
        return{
            content:"模型管理表单",
            form:{}
        }
    },
    methods:{
        submitHandler(){
            let url ="http://localhost:8888/module/saveOrUpdate"
            post(url,this.form).then(resp => {
                this.$message ({
                    type:"success" ,
                    message:resp.message
                })
                this.goBack()
                
            })
        },
        goBack(){
            this.$router.go(-1)
        }
    },
    created(){
        this.form = this.$route.query;
    }
    
    
}
</script>

<style lang="sass" scoped>

</style>